import requests
API_key = '4udXjI9wvOnmb6uKVqr7gS0iwvSQcmc6'
API_sercret = 'FtFY8-LLw7rHqVd6NEsUviJ7PJE5ASJg'
def face_detect(API_key,API_sercret,image_path,landmark=None,attributes=None,face_rectangle=None,beauty_score_min=0,beauty_score_max=100):
    """该函数为调用face++ face_detect接口,用于人脸检测"""
    base_url = 'https://api-cn.faceplusplus.com/facepp/v3/detect'
    files = {'image_file': (image_path, open(image_path, 'rb'), 'multipart/form-data')}
    payload = {
            'api_key':API_key,
            'api_secret':API_sercret,
            'image_url':image_url,
            "return_landmark":landmark,
            "return_attributes":attributes,
            "face_rectangle":face_rectangle,
            "beauty_score_min":beauty_score_min,
            "beauty_score_max":beauty_score_max
            
            }
    

    r = requests.post(base_url, params = payload,files = files )
    return r.json()